package com.example.jksj.bookmanagement.pro.message.fragment;
/*
 *  项目名：    SharedRefrigerators
 *  包名：      com.sr.sharedrefrigerators.fragment
 *  文件名:     HomeFragment
 *  创建者:     HXD
 *  创建时间:   2018/11/25 12:13
 *  描述:       TODO
 */


import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.example.jksj.bookmanagement.Base.BaseApplication;
import com.example.jksj.bookmanagement.R;
import com.example.jksj.bookmanagement.pro.message.adapter.LendMessageAdapter;
import com.example.jksj.bookmanagement.bean.LendMessageBean;
import com.example.jksj.bookmanagement.common.MyLazyFragment;

import org.xutils.ex.DbException;

import java.util.ArrayList;
import java.util.List;


public class MessageFragment extends MyLazyFragment {
    private RecyclerView mRecyclerView;
    private List<LendMessageBean> lendMessageBeanList;
    private LinearLayoutManager recyclerViewLayoutManager;
    private LendMessageAdapter lendMessageAdapter;

    public static MessageFragment newInstance() {
        return new MessageFragment();
    }

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_message;
    }

    @Override
    protected int getTitleBarId() {
        return 0;
    }

    @Override
    public void initView() {
        mRecyclerView = getView().findViewById(R.id.rv_messageFragment);
        recyclerViewLayoutManager = new LinearLayoutManager(getContext());
        recyclerViewLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
        mRecyclerView.setLayoutManager(recyclerViewLayoutManager);
    }

    @Override
    public void initData() {
        lendMessageBeanList = new ArrayList<>();
        lendMessageBeanList.add(new LendMessageBean("2018-12-10 11:19"));
        lendMessageBeanList.add(new LendMessageBean("2018-11-10 01:19"));
        lendMessageBeanList.add(new LendMessageBean("2018-06-17 11:18"));
        lendMessageBeanList.add(new LendMessageBean("2018-04-10 21:31"));
        lendMessageBeanList.add(new LendMessageBean("2018-01-10 05:01"));
        lendMessageAdapter = new LendMessageAdapter(lendMessageBeanList,getContext());
        mRecyclerView.setAdapter(lendMessageAdapter);


    }
}
